macos: Stop using _gdk_device_query_state
authorMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 19:33:37 +0000 (15:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 26 Aug 2020 21:56:41 +0000 (17:56 -0400)
Directly use the backend implementation.

gdk/macos/gdkmacosdevice-private.h [new file with mode: 0644]
gdk/macos/gdkmacosdevice.c
gdk/macos/gdkmacosdrag.c
gdk/macos/gdkmacossurface.c

diff --git a/gdk/macos/gdkmacosdevice-private.h b/gdk/macos/gdkmacosdevice-private.h
new file mode 100644 (file)
index 0000000..6daafa8
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2020 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#ifndef __GDK_MACOS_DEVICE_PRIVATE_H__
+#define __GDK_MACOS_DEVICE_PRIVATE_H__
+
+#include "gdkdeviceprivate.h"
+
+G_BEGIN_DECLS
+
+void gdk_macos_device_query_state (GdkDevice        *device,
+                                   GdkSurface        *surface,
+                                   GdkSurface       **child_surface,
+                                   double           *win_x,
+                                   double           *win_y,
+                                   GdkModifierType  *mask);
+
+G_END_DECLS
+
+#endif /* __GDK_MACOS_DEVICE_PRIVATE_H__ */
index 94ecbd4041dc2bc0bc27fa0ac2b3cbb7683e0a1f..c590d60c501311d2c0f1d53d1bc894fa71d38124 100644 (file)
@@ -29,7 +29,7 @@
 #include "gdkmacoscursor-private.h"
 #include "gdkmacosdevice.h"
 #include "gdkmacosdisplay-private.h"
-#include "gdkmacossurface-private.h"
+#include "gdkmacosdevice-private.h"
 
 struct _GdkMacosDevice
 {
@@ -126,7 +126,7 @@ gdk_macos_device_ungrab (GdkDevice *device,
   _gdk_display_device_grab_update (display, device, 0);
 }
 
-static void
+void
 gdk_macos_device_query_state (GdkDevice        *device,
                               GdkSurface       *surface,
                               GdkSurface      **child_surface,
index fcc75e6078db5ecd433a5c689204849521fbb791..c89b01948fb32e40b55d04c2d9725b5037115e78 100644 (file)
@@ -22,6 +22,7 @@
 #include "gdkdeviceprivate.h"
 #include "gdkintl.h"
 
+#include "gdkmacosdevice-private.h"
 #include "gdkmacoscursor-private.h"
 #include "gdkmacosdisplay-private.h"
 #include "gdkmacosdrag-private.h"
@@ -473,7 +474,7 @@ gdk_dnd_handle_key_event (GdkDrag  *drag,
    * to query it here. We could use XGetModifierMapping, but
    * that would be overkill.
    */
-  _gdk_device_query_state (pointer, NULL, NULL, NULL, NULL, &state);
+  gdk_macos_device_query_state (pointer, NULL, NULL, NULL, NULL, &state);
 
   if (dx != 0 || dy != 0)
     {
index 5f719bb92347b01e368b601f7673cf0ea86dd828..bddbbaf038c54ebb2e6551181b96157b0aee2372 100644 (file)
@@ -32,6 +32,7 @@
 #include "gdksurfaceprivate.h"
 
 #include "gdkmacosdevice.h"
+#include "gdkmacosdevice-private.h"
 #include "gdkmacosdisplay-private.h"
 #include "gdkmacosdrag-private.h"
 #include "gdkmacosdragsurface-private.h"
@@ -307,7 +308,7 @@ gdk_macos_surface_drag_begin (GdkSurface         *surface,
   g_assert (GDK_IS_CONTENT_PROVIDER (content));
 
   seat = gdk_device_get_seat (device);
-  _gdk_device_query_state (device, surface, NULL, &px, &py, NULL);
+  gdk_macos_device_query_state (device, surface, NULL, &px, &py, NULL);
   _gdk_macos_surface_get_root_coords (GDK_MACOS_SURFACE (surface), &sx, &sy);
   drag_surface = _gdk_macos_surface_new (GDK_MACOS_DISPLAY (surface->display),
                                          GDK_SURFACE_TEMP,